package com.xcw.test;

/**
 * @Author bhx
 * @Date 2022/8/9 2:22
 * @Description TODO
 */
public class TreadDemo {
    public static void startThread(Runnable runnable){
        new Thread(runnable).start();
    }

    public static void main(String[] args) {
        startThread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getContextClassLoader() + "执行了线程" + Thread.currentThread().getId());
            }
        });
        startThread(()->{
            System.out.println(Thread.currentThread().getContextClassLoader().getParent() + "执行了线程" + Thread.currentThread().getId());
        });        startThread(()->{
            System.out.println(Thread.currentThread().getContextClassLoader() + "执行了线程" + Thread.currentThread().getId());
        });        startThread(()->{
            System.out.println(Thread.currentThread().getContextClassLoader() + "执行了线程" + Thread.currentThread().getId());
        });        startThread(()->{
            System.out.println(Thread.currentThread().getContextClassLoader() + "执行了线程" + Thread.currentThread().getId());
        });        startThread(()->{
            System.out.println(Thread.currentThread().getContextClassLoader() + "执行了线程" + Thread.currentThread().getId());
        });        startThread(()->{
            System.out.println(Thread.currentThread().getContextClassLoader() + "执行了线程" + Thread.currentThread().getId());
        });
    }

}
